#include "seatdetectionparameter.h"

SeatDetectionParameter::SeatDetectionParameter() {}

SeatDetectionParameter::~SeatDetectionParameter() {}

void SeatDetectionParameter::InitParameter()
{
    // 相机采集图像的原始路径
    originalImagePath = QStringLiteral("D:/Image");
    // 程序处理图像的零时路径
    temporalImagePath = QStringLiteral("D:/Image");
    // Description文件路径
    descriptionFilePath = QStringLiteral("D:/description.xml");
    // Image File 文件类型(后缀)
    imageFileExtension = QStringLiteral("jpg");
    // 程序处理图像后生成的结果路劲（缺陷的txt表示）
    resultTxtPath = QStringLiteral("D:/Image");
    // 提供图像处理的服务器IP地址
    recognitionServerIp = QStringLiteral("127.0.0.1");
    // 提供图像处理的服务程序的Port号
    recognitionServerPort = QStringLiteral("10002");
    // 控制服务器IP地址
    controlServerIp = QStringLiteral("127.0.0.1");
    // 控制服务器Port号
    controlServerPort = QStringLiteral("10001");
    // 里面表示需要检查塌陷的位置
    collapseSurface  = {"1","2","3","4","5"};
    // 相机配置信息
    cameraCount = 8;

    cameras.clear();
    for (int i = 0; i < cameraCount; i++) {
        CAMERA c;
        c.name = QString("Camera%1").arg(i + 1);
        c.MAC = "1234567890ABCDEF";
        c.IP = "169.254.24.225";
        c.numbers << "1"
                  << "2";
        cameras.append(c);
    }
    // 类别配置 "0": "污渍", "1": "褶皱", "2": "断线", "3": "划痕"
    classes.insert(QStringLiteral("污渍"), 0);
    classes.insert(QStringLiteral("褶皱"), 1);
    classes.insert(QStringLiteral("断线"), 2);
    classes.insert(QStringLiteral("划痕"), 3);

    // 检测窗口,设置了座椅检测位置数量，以及在对话框中的排列形式
    detectionTotalSubImageCount = 22;
    detectionRowSubImageCount = 5;
    detectionColumnSubImageCount = 5;

    seatShowInfos.clear();
    SEATSHOWINFO seatshowinfo;
    // 0 缺省位置
    seatshowinfo.angle = QVector3D(-80.0f, 0.0f, 220.0f);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.0, -0.5, 0);
    seatShowInfos.append(seatshowinfo);
    // 1
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 270.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.3, -0.7, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 2
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 270.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.3, -0.3, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 3
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 270.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.2, -0.3, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 4
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 180.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.1, -0.6, 2.5);
    seatShowInfos.append(seatshowinfo);
    // 5
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 180.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.1, -0.6, 2.5);
    seatShowInfos.append(seatshowinfo);
    // 6
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 180.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.1, -0.4, 2.5);
    seatShowInfos.append(seatshowinfo);
    // 7
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 180.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.1, -0.4, 2.5);
    seatShowInfos.append(seatshowinfo);
    // 8
    seatshowinfo.angle = QVector3D(0.0, 0.0, 180.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.1, -0.2, 1.5);
    seatShowInfos.append(seatshowinfo);
    // 9
    seatshowinfo.angle = QVector3D(0.0, 0.0, 180.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.1, -0.2, 1.5);
    seatShowInfos.append(seatshowinfo);
    // 10
    seatshowinfo.angle = QVector3D(0.0, 0.0, 180.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.1, 0.0, 1.5);
    seatShowInfos.append(seatshowinfo);
    // 11
    seatshowinfo.angle = QVector3D(0.0, 0.0, 180.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.1, 0.0, 1.5);
    seatShowInfos.append(seatshowinfo);
    // 12
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 180.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.1, -0.2, 1.5);
    seatShowInfos.append(seatshowinfo);
    // 13
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 180.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.1, -0.2, 1.5);
    seatShowInfos.append(seatshowinfo);
    // 14
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 90.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.4, -0.7, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 15
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 90.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.4, -0.5, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 16
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 90.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.2, -0.3, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 17
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 0.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.1, -0.7, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 18
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 0.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.1, -0.7, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 19
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 0.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.1, -0.5, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 20
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 0.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.1, -0.5, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 21
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 0.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(0.1, -0.3, 1.0);
    seatShowInfos.append(seatshowinfo);
    // 22
    seatshowinfo.angle = QVector3D(-90.0, 0.0, 0.0);
    seatshowinfo.scale = QVector3D(1.0, 1.0, 1.0);
    seatshowinfo.viewpos = QVector3D(-0.1, -0.3, 1.0);
    seatShowInfos.append(seatshowinfo);
}

SeatDetectionParameter& SeatDetectionParameter::operator=(SeatDetectionParameter& obj){
    this->originalImagePath = obj.GetOriginalImagePath();
    this->temporalImagePath = obj.GetTemporalImagePath();
    this->descriptionFilePath = obj.getDescriptionFilePath();
    this->imageFileExtension = obj.getImageFileExtension();
    this->resultTxtPath = obj.GetResultTxtPath();
    this->recognitionServerIp = obj.GetRecognitionServerIp();
    this->recognitionServerPort = obj.GetRecognitionServerPort();
    this->controlServerIp = obj.GetControlServerIp();
    this->controlServerPort = obj.GetControlServerPort();
    this->collapseSurface = obj.GetCollapseSurface();
    this->detectionTotalSubImageCount = obj.GetDetectionTotalSubImageCount();
    this->detectionRowSubImageCount = obj.GetDetectionRowSubImageCount();
    this->detectionColumnSubImageCount = obj.GetDetectionColumnSubImageCount();
    this->cameraCount = obj.GetCameraCount();
    this->cameras = obj.GetCameras();
    this->classes = obj.GetClasses();
    this->seatShowInfos = obj.GetSeatShowInfos();
    return *this;
}

QString SeatDetectionParameter::getDescriptionFilePath() const
{
    return descriptionFilePath;
}

QString SeatDetectionParameter::getImageFileExtension() const
{
    return imageFileExtension;
}

void SeatDetectionParameter::SetDescriptionFilePath(QString descriptionFilePath){
    this->descriptionFilePath = descriptionFilePath;
}

void SeatDetectionParameter::SetImageFileExtension(QString imageFileExtension){
    this->imageFileExtension = imageFileExtension;
}

void SeatDetectionParameter::WriteParameterToXml(QString xmlFilePath)
{
    // 打开或者创建一个XML文件
    QFile file(xmlFilePath);
    // 文件存在则创建，否则创建一个文件
    if (!file.open(QFileDevice::ReadWrite | QFileDevice::Truncate)) {
        qWarning() << QString("参数文件: %1 打开或创建失败!").arg(xmlFilePath);
        QMessageBox::information(NULL, "提示", "参数文件打开或创建失败！");
        return;
    }

    // 创建一个XML类
    QDomDocument doc;

    // 创建XML处理类，通常用于处理第一行描述信息
    QDomProcessingInstruction instruction;

    // 创建XML头部格式
    instruction = doc.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\"");

    // 添加到XML文件中
    doc.appendChild(instruction);

    // 创建根节点
    QDomElement root = doc.createElement("SeatDetection");
    doc.appendChild(root);

    qWarning() << QString("参数保存到参数文件: %1 中...").arg(xmlFilePath);
    /******************************************************************************************************************/
    // 添加子节点
    QDomElement element = doc.createElement("originalImagePath");

    // 设置尖括号中的值
    QDomText text = doc.createTextNode(originalImagePath);
    element.appendChild(text);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    element = doc.createElement("temporalImagePath");

    // 设置尖括号中的值
    text = doc.createTextNode(temporalImagePath);
    element.appendChild(text);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    element = doc.createElement("descriptionFilePath");

    // 设置尖括号中的值
    text = doc.createTextNode(descriptionFilePath);
    element.appendChild(text);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    element = doc.createElement("imageFileExtension");

    // 设置尖括号中的值
    text = doc.createTextNode(imageFileExtension);
    element.appendChild(text);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    element = doc.createElement("resultTxtPath");

    // 设置尖括号中的值
    text = doc.createTextNode(resultTxtPath);
    element.appendChild(text);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    element = doc.createElement("recognitionServerIp");

    // 设置尖括号中的值
    text = doc.createTextNode(recognitionServerIp);
    element.appendChild(text);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    element = doc.createElement("recognitionServerPort");

    // 设置尖括号中的值
    text = doc.createTextNode(recognitionServerPort);
    element.appendChild(text);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    element = doc.createElement("controlServerIp");

    // 设置尖括号中的值
    text = doc.createTextNode(controlServerIp);
    element.appendChild(text);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    element = doc.createElement("controlServerPort");
    // 设置尖括号中的值
    text = doc.createTextNode(controlServerPort);
    element.appendChild(text);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    element = doc.createElement("collapseSurface");
    // 设置尖括号中的值
    text = doc.createTextNode(collapseSurface.join(","));
    element.appendChild(text);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    QDomElement camerasElement = doc.createElement("cameras");
    camerasElement.setAttribute("count", cameraCount);
    for (int i = 0; i < cameras.size(); i++) {
        CAMERA c = cameras.at(i);
        element = doc.createElement("camera");
        element.setAttribute("name", c.name);
        element.setAttribute("MAC", c.MAC);
        element.setAttribute("IP", c.IP);
        element.setAttribute("numbers", c.numbers.join(","));

        camerasElement.appendChild(element);
    }
    root.appendChild(camerasElement);
    /*******************************************************************************************************************/
    // 添加子节点 classes
    QDomElement classesElement = doc.createElement("classes");
    QList<QString> keyList = classes.keys();
    for (QList<QString>::iterator it = keyList.begin(); it != keyList.end(); it++) {
        QDomElement classElement = doc.createElement("class");
        classElement.setAttribute(QStringLiteral("name"), *it);
        text = doc.createTextNode(QString::number(classes[*it]));
        classElement.appendChild(text);
        classesElement.appendChild(classElement);
    }
    root.appendChild(classesElement);
    /*******************************************************************************************************************/
    // 添加子节点 detectionWindow
    element = doc.createElement("detectionWindow");
    element.setAttribute("total", detectionTotalSubImageCount);
    element.setAttribute("row", detectionRowSubImageCount);
    element.setAttribute("column", detectionColumnSubImageCount);
    root.appendChild(element);
    /*******************************************************************************************************************/
    // 添加子节点
    QDomElement seatShowInfosElement = doc.createElement("seatShowInfos");
    QDomElement seatShowInfoElement;
    seatShowInfosElement.setAttribute("count", detectionTotalSubImageCount);
    for (int i = 0; i < seatShowInfos.size(); i++) {
        SEATSHOWINFO seatshowinfo = seatShowInfos.at(i);
        seatShowInfoElement = doc.createElement("seatShowInfo");

        element = doc.createElement("angle");
        element.setAttribute("x", seatshowinfo.angle.x());
        element.setAttribute("y", seatshowinfo.angle.y());
        element.setAttribute("z", seatshowinfo.angle.z());
        seatShowInfoElement.appendChild(element);

        element = doc.createElement("scale");
        element.setAttribute("x", seatshowinfo.scale.x());
        element.setAttribute("y", seatshowinfo.scale.y());
        element.setAttribute("z", seatshowinfo.scale.z());
        seatShowInfoElement.appendChild(element);

        element = doc.createElement("viewpos");
        element.setAttribute("x", seatshowinfo.viewpos.x());
        element.setAttribute("y", seatshowinfo.viewpos.y());
        element.setAttribute("z", seatshowinfo.viewpos.z());
        seatShowInfoElement.appendChild(element);

        seatShowInfosElement.appendChild(seatShowInfoElement);
    }
    root.appendChild(seatShowInfosElement);

    // 将其写入到xml文件中
    QTextStream stream(&file);
    doc.save(stream, 4); // 缩进四格

    file.close();
}

void SeatDetectionParameter::ReadParameterFromXml(QString xmlFilePath)
{
    QFile file(xmlFilePath);
    if (!file.exists()) {
        qInfo() << QString("参数文件: %1 不存在").arg(xmlFilePath);
        InitParameter();
        this->WriteParameterToXml(xmlFilePath);
    }

    if (!file.open(QFileDevice::ReadOnly)) {
        qWarning() << QString("参数文件: %1 打开失败！").arg(xmlFilePath);
        QMessageBox::information(NULL, "提示", "文件打开失败！");
        return;
    }

    QDomDocument doc;
    if (!doc.setContent(&file)) {
        qWarning() << QString("参数文件: %1 不是XML文件！").arg(xmlFilePath);
        QMessageBox::information(NULL, "提示", "操作的文件不是XML文件！");
        file.close();
        return;
    }

    qInfo() << QString("读取参数文件: %1 中保存的值到参数中...").arg(xmlFilePath);
    QDomElement root = doc.documentElement();

    // 读取 OriginalImagePath 的内容
    QDomNodeList list = root.elementsByTagName("originalImagePath");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        this->originalImagePath = element.text();
    }

    // 读取 TemporalImagePath 的内容
    list = root.elementsByTagName("temporalImagePath");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        this->temporalImagePath = element.text();
    }

    // 读取 descriptionFilePath 的内容
    list = root.elementsByTagName("descriptionFilePath");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        this->descriptionFilePath = element.text();
    }

    // 读取 imageFileExtension 的内容
    list = root.elementsByTagName("imageFileExtension");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        this->imageFileExtension = element.text();
    }

    // 读取 ResultTxtPath 的内容
    list = root.elementsByTagName("resultTxtPath");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        this->resultTxtPath = element.text();
    }

    // 读取 RecognitionServerIp 的内容
    list = root.elementsByTagName("recognitionServerIp");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        this->recognitionServerIp = element.text();
    }

    // 读取 RecognitionServerPort 的内容
    list = root.elementsByTagName("recognitionServerPort");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        this->recognitionServerPort = element.text();
    }
    // 读取 ControlServerIp 的内容
    list = root.elementsByTagName("controlServerIp");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        this->controlServerIp = element.text();
    }

    // 读取 ControlServerPort 的内容
    list = root.elementsByTagName("controlServerPort");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        this->controlServerPort = element.text();
    }

    // 读取 ControlServerPort 的内容
    list = root.elementsByTagName("collapseSurface");
    this->collapseSurface.clear();
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        this->collapseSurface = element.text().split(",");
    }

    // 读取 cameras 的内容
    list = root.elementsByTagName("cameras");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        cameraCount = element.attribute("count").toInt();
        break;
    }

    list = root.elementsByTagName("camera");
    cameras.clear();
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        CAMERA camera;
        QDomElement element = list.at(i).toElement();
        camera.name = element.attribute(QStringLiteral("name"));
        camera.MAC = element.attribute(QStringLiteral("MAC"));
        camera.IP = element.attribute(QStringLiteral("IP"));
        camera.numbers = element.attribute(QStringLiteral("numbers")).split(",");
        cameras.append(camera);
    }

    list = root.elementsByTagName("class");
    classes.clear();
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        CAMERA camera;
        QDomElement element = list.at(i).toElement();
        QString className = element.attribute(QStringLiteral("name"));
        QString classNumber = element.text();
        classes.insert(className, classNumber.toInt());
    }
    // 读取 detectionWindow 的内容
    list = root.elementsByTagName("detectionWindow");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        detectionTotalSubImageCount = element.attribute("total").toInt();
        detectionRowSubImageCount = element.attribute("row").toInt();
        detectionColumnSubImageCount = element.attribute("column").toInt();
        break;
    }

    // 读取 seatShowInfos 的内容
    list = root.elementsByTagName("seatShowInfos");
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        QDomElement element = list.at(i).toElement();
        // 暂时没有使用
        int count = element.attribute("count").toInt();
        break;
    }

    list = root.elementsByTagName("seatShowInfo");
    seatShowInfos.clear();
    /* 获取属性中的值 */
    for (int i = 0; i < list.count(); i++) {
        // 获取链表中的值
        SEATSHOWINFO seatShowInfo;
        QDomElement element = list.at(i).toElement();
        QDomElement angleElement = element.firstChildElement(QStringLiteral("angle"));
        seatShowInfo.angle.setX(angleElement.attribute("x").toFloat());
        seatShowInfo.angle.setY(angleElement.attribute("y").toFloat());
        seatShowInfo.angle.setZ(angleElement.attribute("z").toFloat());

        QDomElement scaleElement = element.firstChildElement(QStringLiteral("scale"));
        seatShowInfo.scale.setX(scaleElement.attribute("x").toFloat());
        seatShowInfo.scale.setY(scaleElement.attribute("y").toFloat());
        seatShowInfo.scale.setZ(scaleElement.attribute("z").toFloat());

        QDomElement viewposElement = element.firstChildElement(QStringLiteral("viewpos"));
        seatShowInfo.viewpos.setX(viewposElement.attribute("x").toFloat());
        seatShowInfo.viewpos.setY(viewposElement.attribute("y").toFloat());
        seatShowInfo.viewpos.setZ(viewposElement.attribute("z").toFloat());

        seatShowInfos.append(seatShowInfo);
    }

    file.close();
}

void SeatDetectionParameter::ConfigCameraToXml(QString xmlFilePath) {}

QString SeatDetectionParameter::toString()
{
    return QString("%1 %2 %3 %4 %5")
        .arg(originalImagePath,
             temporalImagePath,
             resultTxtPath,
             recognitionServerIp,
             recognitionServerPort);
}
